package com.sqllite.springbootsqlitejdbc.controller;


import com.sqllite.springbootsqlitejdbc.bean.CreditRepay60;
import com.sqllite.springbootsqlitejdbc.service.CreditRepay60Service;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/credit-repay-60")
public class CreditRepay60Controller {
    private final CreditRepay60Service creditRepay60Service;

    public CreditRepay60Controller(CreditRepay60Service creditRepay60Service) {
        this.creditRepay60Service = creditRepay60Service;
    }

    @GetMapping
    public ResponseEntity<List<CreditRepay60>> getAllCreditRepays() {
        List<CreditRepay60> creditRepays = creditRepay60Service.getAllCreditRepays();
        return ResponseEntity.ok(creditRepays);
    }
}
